Optimal. Leaf size=14 \[ x^2-x \tan (x)-\log (\cos (x)) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0331439, antiderivative size = 14, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 4, integrand size = 10, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.4, Rules used = {4431, 3720, 3475, 30} \[ x^2-x \tan (x)-\log (\cos (x)) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 4431
Rule 3720
Rule 3475
Rule 30
Rubi steps
\begin{align*} \int x \cos (2 x) \sec ^2(x) \, dx &=\int \left (x-x \tan ^2(x)\right ) \, dx\\ &=\frac{x^2}{2}-\int x \tan ^2(x) \, dx\\ &=\frac{x^2}{2}-x \tan (x)+\int x \, dx+\int \tan (x) \, dx\\ &=x^2-\log (\cos (x))-x \tan (x)\\ \end{align*}
Mathematica [A] time = 0.0232502, size = 14, normalized size = 1. \[ x^2-x \tan (x)-\log (\cos (x)) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.042, size = 15, normalized size = 1.1 \begin{align*}{x}^{2}-\ln \left ( \cos \left ( x \right ) \right ) -x\tan \left ( x \right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] time = 1.56808, size = 150, normalized size = 10.71 \begin{align*} \frac{2 \, x^{2} \cos \left (2 \, x\right )^{2} + 2 \, x^{2} \sin \left (2 \, x\right )^{2} + 4 \, x^{2} \cos \left (2 \, x\right ) + 2 \, x^{2} -{\left (\cos \left (2 \, x\right )^{2} + \sin \left (2 \, x\right )^{2} + 2 \, \cos \left (2 \, x\right ) + 1\right )} \log \left (\cos \left (2 \, x\right )^{2} + \sin \left (2 \, x\right )^{2} + 2 \, \cos \left (2 \, x\right ) + 1\right ) - 4 \, x \sin \left (2 \, x\right )}{2 \,{\left (\cos \left (2 \, x\right )^{2} + \sin \left (2 \, x\right )^{2} + 2 \, \cos \left (2 \, x\right ) + 1\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 0.486144, size = 73, normalized size = 5.21 \begin{align*} \frac{x^{2} \cos \left (x\right ) - \cos \left (x\right ) \log \left (-\cos \left (x\right )\right ) - x \sin \left (x\right )}{\cos \left (x\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] time = 53.0657, size = 144, normalized size = 10.29 \begin{align*} x^{2} + \frac{2 x \tan{\left (\frac{x}{2} \right )}}{\tan ^{2}{\left (\frac{x}{2} \right )} - 1} - \frac{\log{\left (\tan{\left (\frac{x}{2} \right )} - 1 \right )} \tan ^{2}{\left (\frac{x}{2} \right )}}{\tan ^{2}{\left (\frac{x}{2} \right )} - 1} + \frac{\log{\left (\tan{\left (\frac{x}{2} \right )} - 1 \right )}}{\tan ^{2}{\left (\frac{x}{2} \right )} - 1} - \frac{\log{\left (\tan{\left (\frac{x}{2} \right )} + 1 \right )} \tan ^{2}{\left (\frac{x}{2} \right )}}{\tan ^{2}{\left (\frac{x}{2} \right )} - 1} + \frac{\log{\left (\tan{\left (\frac{x}{2} \right )} + 1 \right )}}{\tan ^{2}{\left (\frac{x}{2} \right )} - 1} + \frac{\log{\left (\tan ^{2}{\left (\frac{x}{2} \right )} + 1 \right )} \tan ^{2}{\left (\frac{x}{2} \right )}}{\tan ^{2}{\left (\frac{x}{2} \right )} - 1} - \frac{\log{\left (\tan ^{2}{\left (\frac{x}{2} \right )} + 1 \right )}}{\tan ^{2}{\left (\frac{x}{2} \right )} - 1} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.16055, size = 159, normalized size = 11.36 \begin{align*} \frac{2 \, x^{2} \tan \left (\frac{1}{2} \, x\right )^{2} - \log \left (\frac{4 \,{\left (\tan \left (\frac{1}{2} \, x\right )^{4} - 2 \, \tan \left (\frac{1}{2} \, x\right )^{2} + 1\right )}}{\tan \left (\frac{1}{2} \, x\right )^{4} + 2 \, \tan \left (\frac{1}{2} \, x\right )^{2} + 1}\right ) \tan \left (\frac{1}{2} \, x\right )^{2} - 2 \, x^{2} + 4 \, x \tan \left (\frac{1}{2} \, x\right ) + \log \left (\frac{4 \,{\left (\tan \left (\frac{1}{2} \, x\right )^{4} - 2 \, \tan \left (\frac{1}{2} \, x\right )^{2} + 1\right )}}{\tan \left (\frac{1}{2} \, x\right )^{4} + 2 \, \tan \left (\frac{1}{2} \, x\right )^{2} + 1}\right )}{2 \,{\left (\tan \left (\frac{1}{2} \, x\right )^{2} - 1\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]